package org.openmore.consumer.service.feignImpl;

import feign.hystrix.FallbackFactory;
import org.openmore.consumer.dto.common.BaseResponse;
import org.openmore.consumer.entity.enums.TenantStatus;
import org.openmore.consumer.service.feign.TenantService;
import org.openmore.consumer.dto.common.TenantDto;
import org.springframework.stereotype.Component;
import java.util.Date;

@Component
public class TenantServiceImpl extends BaseFeignFallback implements FallbackFactory<TenantService> {
    @Override
    public TenantService create(Throwable cause) {
        return new TenantService() {
            @Override
            public BaseResponse selectAllByPage(String userId, String name, TenantStatus status, Date createdTimeStart, Date createdTimeEnd, Integer pageNum, Integer pageSize) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse getTenantById(String id) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse updateTenant(TenantDto tenant) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse insertTenant(TenantDto tenant) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse deleteTenant(String id) {
                return getFallBackResponse();
            }
        };
    }
}
